import React, { PureComponent } from 'react';
import { connect } from 'react-redux'
import { actionCreators } from './store'
class Write extends PureComponent {
  render() {
    const { loginStatus } = this.props;
    if (!loginStatus) {
      return (
        <div>
          文章
        </div>
      )
    } else {
      // return <Redirect to="/" />
    }

  }
}
const mapState = (state) => ({
  login: state.getIn(['login', 'login'])
});
const mapDispatch = (dispatch) => (
  {
    login(accountElem, passwordElem) {
      dispatch(actionCreators.login(accountElem.value, passwordElem.value))
    }
  }
)
export default connect(mapState, mapDispatch)(Write);